<?php
/*
 * @Author: liujiachen liujiachen@neuedu.com
 * @Date: 2024-09-13 14:57:41
 * @LastEditors: liujiachen liujiachen@neuedu.com
 * @LastEditTime: 2024-09-13 15:29:17
 * @FilePath: \WWW\phpcode\sql\sql_fengzhaung\config.php
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 声明编码
header("Content-Type:text/html;charset=utf-8");

// 链接数据库 加@符号抑制非致命错误 mysql对象$connect
$connect =  @mysqli_connect("localhost","root","root");
// 链接时提示错误信息
if (!$connect) {
    echo"【链接数据库失败!】:".mysqli_connect_error();
    // 链接时提示错误码
    echo"【链接时提示错误码!】:".mysqli_connect_errno();
    exit();
}
// mysqli_set_charset 	设置编码
$charset = mysqli_set_charset($connect,'UTF8');
if (!$charset) {
    echo"【编码不对!】:".mysqli_error($connect);
    exit();
}
// 选择数据库
$select =  mysqli_select_db($connect, "company");

if (!$select) {
    echo"【数据库不对!】:".mysqli_error($connect);
    exit();
}



